*-----------------------------------------------------------*
* TITLE: Stata Coding for JAERE Manuscript
* AUTHOR: Lauriane Yehouenou
* DATE: 2022-01-26
* VERSION: Stata/SE 16
*-----------------------------------------------------------*

capture log close
set more off, perm 
set seed 123098 

***PERSONAL PATH***
gl d1 "C:\Users\FRE\Dropbox\UF Laury\Dissertation\Essay 2\Writing\Coding" 

*SOMEBODY ELSE PATH*** 
*	if "`c(username)'"=="YOUR USERNAME HERE"{
*		global dir 			"INSERT YOUR PATH"
*		cd "${dir}"
*	}

use Data_JAERE, clear

***SUMMARY STATISTICS***

sum Age Gender Education Religion MaritalStatus Hhead Hsize ActivityPrim1 ActivitySec LaborRate1 LaborRate2  
sum DStimeUse RStimeUse
sum KnowAA UseAA ChangeAA SubAA SellForest
sum Risks Happy Trust Impatient Actions Community Payment
sum Game DecisionMaking Family FamilyNumb Influence Sense

tab1 Risks Happy Trust Impatient Actions Community /*Preferences*/
tab1 Importance1 Importance2 Importance3
tab1 ForestUse1 ForestUse2 ForestUse3 ForestUse4
tab1 DStimeUse RStimeUse
tab1 ReduceUse PaidReduce
tab1 Education Religion MaritalStatus ActivityPrim1 ActivityPrim2 

***MEANS AND TESTS FOR DIFFERENCES***

***Mean harvest of trees by treatment***
ttest Trees if category==1, by (Treatment) welch
ttest Trees if category==2, by (Treatment) welch
ttest Trees if category==3, by (Treatment) welch
ttest Trees if category==4, by (Treatment) welch

sdtest Trees if category==1, by (Treatment)
sdtest Trees if category==2, by (Treatment)
sdtest Trees if category==3, by (Treatment)
sdtest Trees if category==4, by (Treatment)

***Mean harvest of leaves by treatment***
ttest Leaves if category==1, by (Treatment) welch
ttest Leaves if category==2, by (Treatment) welch
ttest Leaves if category==3, by (Treatment) welch
ttest Leaves if category==4, by (Treatment) welch

sdtest Leaves if category==1, by (Treatment)
sdtest Leaves if category==2, by (Treatment)
sdtest Leaves if category==3, by (Treatment)
sdtest Leaves if category==4, by (Treatment)

***Mean difference between treatments for trees***
ttest Trees if Treatment==1 | Treatment==2, by(Treatment) welch
ttest Trees if Treatment==1 | Treatment==3, by(Treatment) welch
ttest Trees if Treatment==1 | Treatment==4, by(Treatment) welch
ttest Trees if Treatment==2 | Treatment==3, by(Treatment) welch
ttest Trees if Treatment==2 | Treatment==4, by(Treatment) welch
ttest Trees if Treatment==3 | Treatment==4, by(Treatment) welch

***Mean difference between treatments in control rounds for trees***
ttest Trees if Treatment==0 & category==1 | Treatment==0 & category==2, by(category) welch
ttest Trees if Treatment==0 & category==1 | Treatment==0 & category==3, by(category) welch
ttest Trees if Treatment==0 & category==1 | Treatment==0 & category==4, by(category) welch
ttest Trees if Treatment==0 & category==2 | Treatment==0 & category==3, by(category) welch
ttest Trees if Treatment==0 & category==2 | Treatment==0 & category==4, by(category) welch
ttest Trees if Treatment==0 & category==3 | Treatment==0 & category==4, by(category) welch

***Mean difference between treatments for Leaves***
ttest Leaves if Treatment==1 | Treatment==2, by(Treatment) welch
ttest Leaves if Treatment==1 | Treatment==3, by(Treatment) welch
ttest Leaves if Treatment==1 | Treatment==4, by(Treatment) welch
ttest Leaves if Treatment==2 | Treatment==3, by(Treatment) welch
ttest Leaves if Treatment==2 | Treatment==4, by(Treatment) welch
ttest Leaves if Treatment==3 | Treatment==4, by(Treatment) welch

***Mean difference between treatments in control rounds for leaves***
ttest Leaves if Treatment==0 & category==1 | Treatment==0 & category==2, by(category) welch
ttest Leaves if Treatment==0 & category==1 | Treatment==0 & category==3, by(category) welch
ttest Leaves if Treatment==0 & category==1 | Treatment==0 & category==4, by(category) welch
ttest Leaves if Treatment==0 & category==2 | Treatment==0 & category==3, by(category) welch
ttest Leaves if Treatment==0 & category==2 | Treatment==0 & category==4, by(category) welch
ttest Leaves if Treatment==0 & category==3 | Treatment==0 & category==4, by(category) welch

***F-test for joint equality of means***
oneway Trees category if Treatment==0 
oneway Trees Treatment if Treatment==1 | Treatment==2 |Treatment==3 |Treatment==4
oneway Leaves category if Treatment==0 
oneway Leaves Treatment if Treatment==1 | Treatment==2 |Treatment==3 |Treatment==4

***Balance Table without regression***
keep if Round==11
tabulate Education, gen(dum_edu)

eststo T1: estpost summarize Age Gender dum_edu1 Hsize SellForest Risks Happy Trust Impatient Actions Community if Treatment==1
eststo T2: estpost summarize Age Gender dum_edu1 Hsize SellForest Risks Happy Trust Impatient Actions Community if Treatment==2
eststo T3: estpost summarize Age Gender dum_edu1 Hsize SellForest Risks Happy Trust Impatient Actions Community if Treatment==3
eststo T4: estpost summarize Age Gender dum_edu1 Hsize SellForest Risks Happy Trust Impatient Actions Community if Treatment==4
esttab T1 T2 T3 T4 using Balance.rtf,  replace cell("mean(fmt(2)) sd(fmt(2))") nonumber nostar coeflabel(dum_edu1 "Education" Hsize "Household size" SellForest "Sell Forest Products") mtitle("Treatment1" "Treatment2" "Treatment3" "Treatment4") title(Table. Balance statistics)

***F-test***
global DESCVARS Age Gender dum_edu1 Hsize SellForest Risks Happy Trust Impatient Actions Community
mata: mata clear

local count: word count $DESCVARS
mat sumstat = J(`count',1,.)

local i = 1
foreach var in $DESCVARS {
    quietly: oneway `var' Treatment if Treatment==1 | Treatment==2 |Treatment==3 |Treatment==4 
    mat sumstat[`i',1] = r(F)
     local i = `i' + 1
}
frmttable, statmat(sumstat) store(sumstat) sfmt(f)


***Regressions***
use Data_JAERE, clear

gen RisksN=(Risks-1.63)/0.96
gen HappyN=(Happy-1.68)/0.62
gen TrustN=(Trust-2)/0.82
gen ImpatientN=(Impatient-2.1)/0.78
gen ActionsN=(Actions-1.98)/0.81
gen CommunityN=(Community-2.58)/1.57

gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10

tabulate Village, gen(dum_vil)
tabulate Group, gen(dum_grp)

***Regression (Table 7)***
xi: regress Trees i.Treatment, r cluster (Group) /*Treatments only*/
estimates store model1
xi: regress Leaves i.Treatment, r cluster (Group) /*Treatments only*/
estimates store model2
xi: regress Trees i.Treatment i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model3
xi: regress Leaves i.Treatment i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model4
xi: regress Trees i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Group dum_vil*, r cluster (Group) /*All*/
estimates store model5
xi: regress Leaves i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Group dum_vil*, r cluster (Group) /*All*/
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using Tab.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace


***Regression that control for mover fixed effects (i.e., first mover, second mover, etc.)***
xi: regress Trees i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Group dum_vil* Order, r cluster (Group) /*All*/
estimates store model1
xi: regress Leaves i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Group dum_vil* Order, r cluster (Group) /*All*/
estimates store model2
esttab model1 model2 using MoverTab.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace


***Regression (additional set of models only controlling for risk, treatment, and rounds)***
xi: regress Trees i.Treatment Risks, r cluster (Group) 
estimates store model1
xi: regress Leaves i.Treatment Risks, r cluster (Group) 
estimates store model2
xi: regress Trees i.Treatment i.roundN Risks, r cluster (Group) 
estimates store model3
xi: regress Leaves i.Treatment i.roundN Risks, r cluster (Group) 
estimates store model4
xi: regress Trees i.Treatment i.roundN Risks dum_vil* Family, r cluster (Group) 
estimates store model5
xi: regress Leaves i.Treatment i.roundN Risks dum_vil* Family, r cluster (Group) 
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using Tab0.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace


***Regression for both (individual vs group) and (high vs low)***
gen indVgrp=.
replace indVgrp=1 if Treatment==2 | Treatment==4 /*For Individual Treatments*/
replace indVgrp=2 if Treatment==1 | Treatment==3 /*For Group Treatments*/
replace indVgrp=0 if Treatment==0

xi: regress Trees i.indVgrp, r cluster (Group) /*Treatments only*/
estimates store model1
xi: regress Leaves i.indVgrp, r cluster (Group) /*Treatments only*/
estimates store model2
xi: regress Trees i.indVgrp i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model3
xi: regress Leaves i.indVgrp i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model4
xi: regress Trees i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model5
xi: regress Leaves i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using Tab1.csv, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress

gen higVlow=.
replace higVlow=1 if Treatment==1 | Treatment==2 /*For Low Treatments*/
replace higVlow=2 if Treatment==3 | Treatment==4 /*For High Treatments*/
replace higVlow=0 if Treatment==0

xi: regress Trees i.higVlow, r cluster (Group) /*Treatments only*/
estimates store model1
xi: regress Leaves i.higVlow, r cluster (Group) /*Treatments only*/
estimates store model2
xi: regress Trees i.higVlow i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model3
xi: regress Leaves i.higVlow i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model4
xi: regress Trees i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model5
xi: regress Leaves i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using Tab2.csv, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress

***Merging Individual v. Group Low v. High Results in a table***
xi: regress Trees i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model1
xi: regress Leaves i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model2
xi: regress Trees i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model3
xi: regress Leaves i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family, r cluster (Group)/*All*/
estimates store model4
esttab model1 model2 model3 model4 using IGvLH.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress
testparm _IindVgrp_*
testparm _IindVgrp_*, equal
testparm _IhigVlow_*
testparm _IhigVlow_*, equal


***Individual v. Group Low v. High Results in a table with mover fixed effects***
xi: regress Trees i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family Order, r cluster (Group)/*All*/
estimates store model1
xi: regress Leaves i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family Order, r cluster (Group)/*All*/
estimates store model2
xi: regress Trees i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family Order, r cluster (Group)/*All*/
estimates store model3
xi: regress Leaves i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN dum_vil* Family Order, r cluster (Group)/*All*/
estimates store model4
esttab model1 model2 model3 model4 using MoverIGvLH.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress
testparm _IindVgrp_*
testparm _IindVgrp_*, equal
testparm _IhigVlow_*
testparm _IhigVlow_*, equal

***Regression for only control rounds***
drop if Treatment>0
drop if Group==39
drop if Group==11
xi: regress Trees i.category, r cluster (Group) /*Treatments only*/
estimates store model1
xi: regress Leaves i.category, r cluster (Group) /*Treatments only*/
estimates store model2
xi: regress Trees i.category i.roundN Family, r cluster (Group) /*Treatments + Rounds*/
estimates store model3
xi: regress Leaves i.category i.roundN Family, r cluster (Group) /*Treatments + Rounds*/
estimates store model4
xi: regress Trees i.category i.roundN Family Group dum_vil*, r cluster (Group)
estimates store model5
xi: regress Leaves i.category i.roundN Family Group dum_vil*, r cluster (Group)
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using Tab3.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace
testparm _Icategory_*
testparm _Icategory_*, equal

***Table 7 Rerun with outliers removed***
drop if Group==39
drop if Group==11
xi: regress Trees i.Treatment, r cluster (Group) /*Treatments only*/
estimates store model1
xi: regress Leaves i.Treatment, r cluster (Group) /*Treatments only*/
estimates store model2
xi: regress Trees i.Treatment i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model3
xi: regress Leaves i.Treatment i.roundN, r cluster (Group) /*Treatments + Rounds*/
estimates store model4
xi: regress Trees i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group) /*All*/
estimates store model5
xi: regress Leaves i.Treatment i.roundN Age Gender Education Hsize SellForest Risks HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group) /*All*/
estimates store model6
esttab model1 model2 model3 model4 model5 model6 using RerunTab.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace

***Table 8 Rerun with outliers removed***
drop if Group==39
drop if Group==11
xi: regress Trees i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group)/*All*/
estimates store model1
xi: regress Leaves i.indVgrp i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group)/*All*/
estimates store model2
xi: regress Trees i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group)/*All*/
estimates store model3
xi: regress Leaves i.higVlow i.roundN Age Gender Education Hsize SellForest RisksN HappyN TrustN ImpatientN ActionsN CommunityN Family Order Group dum_vil*, r cluster (Group)/*All*/
estimates store model4
esttab model1 model2 model3 model4 using RerunIGvLH.rtf, b(3) se(3) ar2(3) varwidth(25) star(* 0.10 ** 0.05 *** 0.01) compress replace
testparm _IindVgrp_*
testparm _IindVgrp_*, equal
testparm _IhigVlow_*
testparm _IhigVlow_*, equal


***GRAPH 1***
use Data_JAERE.dta, clear 

gen str Treat= "Control" if Treatment==0
replace Treat= "LowGroupPES" if Treatment==1
replace Treat= "LowIndPES" if Treatment==2
replace Treat= "HighGroupPES" if Treatment==3
replace Treat= "HighIndPES" if Treatment==4

graph bar (mean) Trees (mean) Leaves, over(Treat) bar(1, fcolor(orange)) bar(2, fcolor(blue)) blabel(bar, size(small) ///
format(%9.2g) justification(center) alignment(top)) yscale(range(0 4.5)) ///
ylabel(, angle(horizontal)) legend(on) graphregion(margin(zero) fcolor(none) ///
lcolor(black) lwidth(medium) lpattern(solid) ifcolor(none) ilcolor(black) ///
ilwidth(medium) ilpattern(solid)) graphregion(fcolor(white)) plotregion(lcolor(black) lwidth(thin) ///
lpattern(solid)) saving(graph1, replace)

***GRAPH 2 & 3***
use Data_JAERE.dta, clear 
gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10

collapse (mean) Trees Leaves, by(category Treatment Round roundN)

graph twoway connected Trees roundN if category == 1, name(graph1, replace)
graph twoway connected Trees roundN if category == 2, name(graph2, replace)
graph twoway connected Trees roundN if category == 3, name(graph3, replace)
graph twoway connected Trees roundN if category == 4, name(graph4, replace)

separate Trees, by(category)
graph twoway connected Trees1 Trees2 Trees3 Trees4 roundN, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)20) ylabel(1(0.5)3.5) xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graph_all, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 roundN if Round<11, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(1(0.5)3.5) title("Pre-Treatments") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(grapha, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 roundN if Round>10, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(1(0.5)3.5) title("Treatments") yline(2, lp(dash) lw(0.5) lc(red)) xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphb, replace)

grc1leg grapha.gph graphb.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graph2, replace)

separate Leaves, by(category)
graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 roundN, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)20) ylabel(1(1)8) xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graph_all, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 roundN if Round<11, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(1(1)8) title("Pre-Treatments") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphc, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 roundN if Round>10, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(1(1)8) title("Treatments") xtitle("Rounds") ytitle("Mean of Leaes harvested") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphd, replace)

grc1leg graphc.gph graphd.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graph3, replace)


***INDIVIDUAL BEHAVIOR FIGURES***
use Data_JAERE.dta, clear 
gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10

collapse (mean) Trees Leaves, by(category Treatment PlayerID Round roundN)

separate Trees, by(PlayerID)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round<11 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphe1, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round>10 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) yline(2, lp(dash) lw(0.5) lc(red)) title("LowGroupPES") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphe2, replace)

grc1leg graphe1.gph graphe2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphe, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round<11 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphf1, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round>10 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) yline(2, lp(dash) lw(0.5) lc(red)) title("LowIndividualPES") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphf2, replace)

grc1leg graphf1.gph graphf2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphf, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round<11 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)6) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphg1, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round>10 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) yline(2, lp(dash) lw(0.5) lc(red)) title("HighGroupPES") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphg2, replace)

grc1leg graphg1.gph graphg2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphg, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round<11 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphh1, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 roundN if Round>10 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)5) yline(2, lp(dash) lw(0.5) lc(red)) title("HighIndividualPES") xtitle("Rounds") ytitle("Mean of Trees harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphh2, replace)

grc1leg graphh1.gph graphh2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphh, replace)


grc1leg graphe.gph graphf.gph graphg.gph graphh.gph, iscale (*0.8) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graph4, replace)


separate Leaves, by(PlayerID)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round<11 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphi1, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round>10 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("LowGroupPES") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphi2, replace)

grc1leg graphi1.gph graphi2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphi, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round<11 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphj1, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round>10 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("LowIndividualPES") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphj2, replace)

grc1leg graphj1.gph graphj2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphj, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round<11 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphk1, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round>10 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)8) title("HighGroupPES") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphk2, replace)

grc1leg graphk1.gph graphk2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphk, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round<11 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)9) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphl1, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Leaves5 roundN if Round>10 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(1)9) title("HighIndividualPES") xtitle("Rounds") ytitle("Mean of Leaves harvested") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphl2, replace)

grc1leg graphl1.gph graphl2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphl, replace)

grc1leg graphi.gph graphj.gph graphk.gph graphl.gph, iscale (*0.8) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graph5, replace)


***INDIVIDUAL PAYMENT FIGURES***
use Data_JAERE.dta, clear 
gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10

collapse (mean) Payoffs, by(category Treatment PlayerID Round roundN)

separate Payoffs, by(PlayerID)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round<11 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphe1, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round>10 & category==1, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("LowGroupPES") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphe2, replace)

grc1leg graphe1.gph graphe2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphe, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round<11 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphf1, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round>10 & category==2, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("LowIndividualPES") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphf2, replace)

grc1leg graphf1.gph graphf2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphf, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round<11 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphg1, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round>10 & category==3, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("HighGroupPES") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphg2, replace)

grc1leg graphg1.gph graphg2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphg, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round<11 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("PreTreatments") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphh1, replace)

graph twoway connected Payoffs1 Payoffs2 Payoffs3 Payoffs4 Payoffs5 roundN if Round>10 & category==4, msymbol(T D S +) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)10) ylabel(0(400)2000) title("HighIndividualPES") xtitle("Rounds") ytitle("Mean of Payments") legend(label(1 "First Mover") label(2 "Second Mover") label(3 "Third Mover") label (4 "Fourth Mover") label (5 "Fifth Mover")) legend(size(small)) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(graphh2, replace)

grc1leg graphh1.gph graphh2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphh, replace)


grc1leg graphe.gph graphf.gph graphg.gph graphh.gph, iscale (*0.8) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graph4, replace)



***GRAPH 6 & 7***
use Data_JAERE.dta, clear 
gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10
replace LeavesRemaining=0 if LeavesRemaining<0

collapse (mean) TreesRemaining LeavesRemaining, by(category Treatment Round roundN)

separate TreesRemaining, by(category)

graph twoway connected TreesRemaining1 TreesRemaining2 TreesRemaining3 TreesRemaining4 roundN if Round<11, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(0(5)50) title("Pre-Treatments") yline(35, lp(dash) lw(0.5) lc(red)) xtitle("Rounds") ytitle("Mean of Trees Remaining") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphA1, replace)

graph twoway connected TreesRemaining1 TreesRemaining2 TreesRemaining3 TreesRemaining4 roundN if Round>10, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(0(5)50) title("Treatments") yline(35, lp(dash) lw(0.5) lc(red)) xtitle("Rounds") ytitle("Mean of Trees Remaining") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphA2, replace)

grc1leg graphA1.gph graphA2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphA, replace)

separate LeavesRemaining, by(category)

graph twoway connected LeavesRemaining1 LeavesRemaining2 LeavesRemaining3 LeavesRemaining4 roundN if Round<11, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(0(5)50) title("Pre-Treatments") xtitle("Rounds") ytitle("Mean of Leaves Remaining") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphB1, replace)

graph twoway connected LeavesRemaining1 LeavesRemaining2 LeavesRemaining3 LeavesRemaining4 roundN if Round>10, msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) cmissing(y) xlabel(1(1)10) ylabel(0(5)50) title("Treatments")  xtitle("Rounds") ytitle("Mean of Leaves Remaining") legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) saving(graphB2, replace)

grc1leg graphB1.gph graphB2.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid))saving(graphB, replace)



***GRAPH Appendix***
use AllData.dta, clear 

collapse (mean) Trees Leaves, by(category Treatment Village Round)

separate Trees, by(category)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Foky", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Foky") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphA, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Anakpa", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Anakpa") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphB, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Sekpongon", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Sekpongon") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphC, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Djegbatin", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Djegbatin") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphD, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Lagbaman", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Lagbaman") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphE, replace)

graph twoway connected Trees1 Trees2 Trees3 Trees4 Round if Village=="Kpota", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(0.5)5)title("Kpota") xtitle("Rounds") ytitle("Mean of Trees harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphF, replace)

separate Leaves, by(category)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Foky", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Foky") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphA, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Anakpa", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Anakpa") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphB, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Sekpongon", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Sekpongon") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphC, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Djegbatin", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Djegbatin") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphD, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Lagbaman", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Lagbaman") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphE, replace)

graph twoway connected Leaves1 Leaves2 Leaves3 Leaves4 Round if Village=="Kpota", msymbol(T D S) lpattern(dash shortdash longdash) lw(medium) xlabel(1(1)20) ylabel(0(1)10)title("Kpota") xtitle("Rounds") ytitle("Mean of Leaves harvested") xline(10.5, lp(dash) lw(0.5) lc(red)) legend(label(1 "Low Group PES") label(2 "Low Individual PES") label(3 "High Group PES") label (4 "High Individual PES")) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) name(graphF, replace)

**Graph harvest decisions per group in control rounds**
use Data_JAERE.dta, clear 
gen roundN=.
replace roundN=Round if Round<11
replace roundN=Round-10 if Round>10

collapse (mean) Trees Leaves, by(Group category Treatment Round roundN)

*graph twoway scatter Trees roundN if category == 1 & Treatment == 0, name(test1, replace)
separate Trees, by(Group)
graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 Trees6 Trees7 Trees8 Trees9 Trees10 Trees11 Trees12 Trees13 Trees14 Trees15 Trees16 Trees17 Trees18 Trees19 Trees20 Trees21 Trees22 Trees23 Trees24 Trees25 Trees26 Trees27 Trees28 Trees29 Trees30 Trees31 Trees32 Trees33 Trees34 Trees35 Trees36 Trees37 Trees38 Trees39 Trees40 Trees41 Trees42 Trees43 Trees44 Trees45 Trees46 Trees47 Trees48 roundN if Treatment==0 & category==1, xlabel(1(1)10) ylabel(0(1)5) title("Harvest decisions per group in control rounds for Low-Group PES", size(medium)) xtitle("Rounds") ytitle("Mean of Trees harvested") legend(off) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(Control1, replace) 
graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 Trees6 Trees7 Trees8 Trees9 Trees10 Trees11 Trees12 Trees13 Trees14 Trees15 Trees16 Trees17 Trees18 Trees19 Trees20 Trees21 Trees22 Trees23 Trees24 Trees25 Trees26 Trees27 Trees28 Trees29 Trees30 Trees31 Trees32 Trees33 Trees34 Trees35 Trees36 Trees37 Trees38 Trees39 Trees40 Trees41 Trees42 Trees43 Trees44 Trees45 Trees46 Trees47 Trees48 roundN if Treatment==0 & category==2, xlabel(1(1)10) ylabel(0(1)5) title("Harvest decisions per group in control rounds for Low-Individual PES", size(medium)) xtitle("Rounds") ytitle("Mean of Trees harvested") legend(off) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(Control2, replace) 
graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 Trees6 Trees7 Trees8 Trees9 Trees10 Trees11 Trees12 Trees13 Trees14 Trees15 Trees16 Trees17 Trees18 Trees19 Trees20 Trees21 Trees22 Trees23 Trees24 Trees25 Trees26 Trees27 Trees28 Trees29 Trees30 Trees31 Trees32 Trees33 Trees34 Trees35 Trees36 Trees37 Trees38 Trees39 Trees40 Trees41 Trees42 Trees43 Trees44 Trees45 Trees46 Trees47 Trees48 roundN if Treatment==0 & category==3, xlabel(1(1)10) ylabel(0(1)5) title("Harvest decisions per group in control rounds for High-Group PES", size(medium)) xtitle("Rounds") ytitle("Mean of Trees harvested") legend(off) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(Control3, replace) 
graph twoway connected Trees1 Trees2 Trees3 Trees4 Trees5 Trees6 Trees7 Trees8 Trees9 Trees10 Trees11 Trees12 Trees13 Trees14 Trees15 Trees16 Trees17 Trees18 Trees19 Trees20 Trees21 Trees22 Trees23 Trees24 Trees25 Trees26 Trees27 Trees28 Trees29 Trees30 Trees31 Trees32 Trees33 Trees34 Trees35 Trees36 Trees37 Trees38 Trees39 Trees40 Trees41 Trees42 Trees43 Trees44 Trees45 Trees46 Trees47 Trees48 roundN if Treatment==0 & category==4, xlabel(1(1)10) ylabel(0(1)5) title("Harvest decisions per group in control rounds for High-Individual PES", size(medium)) xtitle("Rounds") ytitle("Mean of Trees harvested") legend(off) plotregion(style(none)) plotregion(fcolor(white)) graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(Control4, replace) 

*search grc1leg /*To install*/
grc1leg Control1.gph Control2.gph Control3.gph Control4.gph, graphregion(fcolor(white)) graphregion(lcolor(black) lwidth(medium) lpattern(solid)) saving(Controls, replace) 


***Kolmogorov–Smirnov test***
use Data_JAERE.dta, clear 
collapse (mean) Payoffs, by(category Treatment PlayerID Round)
drop if Treatment==0
drop if Treatment==1
drop if Treatment==2

ksmirnov Payoffs, by(Treatment) exact

***Average payments per player per treatment***
use Data_JAERE.dta, clear 
drop if Treatment==1
drop if Treatment==2
drop if Treatment==3
drop if Treatment==4
collapse (sum) Payoffs, by(category Treatment PlayerID Round)
separate Payoffs, by(PlayerID)
sum Payoffs*

*********************************************
*		End of Do-File						*	
*********************************************